package com.chinatgl.latte.ec.main.sort.list;

import android.graphics.Color;
import android.graphics.Typeface;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.chinatgl.latte.ec.R;
import com.chinatgl.latte.ec.main.sort.content.SectionBean;

import java.util.List;

/**
 * Created by 傅令杰
 */

public class SortRecyclerAdapter extends BaseQuickAdapter<SectionBean> {


    private int selectPos=0;
    public SortRecyclerAdapter( List<SectionBean> data) {
        super(R.layout.item_vertical_menu_list, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, SectionBean bean) {
        if(selectPos==helper.getAdapterPosition()){
            helper.setVisible(R.id.item_main_left_bg,true);
            helper.convertView.setBackgroundColor(Color.parseColor("#FFFFFF"));
            helper.setTextColor(R.id.item_main_left_type, Color.parseColor("#000000"));
            helper.setTypeface(R.id.item_main_left_type, Typeface.defaultFromStyle(Typeface.BOLD));
//			TextView view = helper.getView(R.id.item_main_left_type);
//			view.setTextSize(15);
        }else{
            helper.convertView.setBackgroundColor(Color.parseColor("#f3f3f3"));  //f3f3f3
            helper.setTextColor(R.id.item_main_left_type, Color.parseColor("#333333"));
            helper.setVisible(R.id.item_main_left_bg,false);
            helper.setTypeface(R.id.item_main_left_type, Typeface.defaultFromStyle(Typeface.NORMAL));
//			TextView view = helper.getView(R.id.item_main_left_type);
//			view.setTextSize(13);
        }

        helper.setText(R.id.item_main_left_type,bean.getName());

    }


    public int getSelectPos() {
        return selectPos;
    }

    public void setSelectPos(int selectPos) {
        this.selectPos = selectPos;
    }
}
